﻿using System;
using System.Security.Cryptography;


namespace MyFifthCsharp2
{
    internal class Program
    {/// <summary>
     /// Keygame
     /// </summary>
     /// <param name="args"></param>
        static void Main(string[] args)
        {
            //设置测试次数
            const int n = 5;
            int Count = 0;
            DateTime Begintime = DateTime.Now;
            //给提示按键
            for (int i = 0; i < n; i++)
            { 
                
                //随机生成0-9的随机数            
                Random random = new Random();
                int randomnumber = random.Next(0, 10);
              

                Console.Write($"请输入{randomnumber}  ");
                //判断正误并统计错误次数
                int input = Convert.ToInt32(Console.ReadLine());
                if (input != randomnumber)
                {
                   
                    Count++;
                    Console.WriteLine($"已经输错{Count}次了！");
                   
                }
            }


            //计时
            DateTime Endingtime = DateTime.Now;
            var Testtime = Endingtime.Subtract(Begintime);
            Console.Write($"总共用时{Testtime}");


        }
    }
}